import request from '@/utils/request'

// 查询往来客户列表
export function listCustomer(query) {
  return request({
    url: '/project/customer/list',
    method: 'get',
    params: query
  })
}

export function merge(query) {
  return request({
    url: '/project/customer/merge',
    method: 'get',
    params: query
  })
}

// 首页查询待审核
export function auditList(query) {
  return request({
    url: '/project/customer/auditList',
    method: 'get',
    params: query
  })
}


export function getCustomerSale(query) {
  return request({
    url: '/project/customer/getCustomer',
    method: 'get',
    params: query
  })
}


// 查询往来客户详细
export function getCustomer(id) {
  return request({
    url: '/project/customer/' + id,
    method: 'get'
  })
}

export function listCustomerSale(query) {
  return request({
    url: '/project/accounting/getCustomer',
    method: 'get',
    params: query
  })
}

export function saleConfigInfo(query) {
  return request({
    url: '/project/accounting/saleConfigInfo',
    method: 'get',
    params: query
  })
}



// 新增往来客户
export function addCustomer(data) {
  return request({
    url: '/project/customer',
    method: 'post',
    data: data
  })
}

// 修改往来客户
export function updateCustomer(data) {
  return request({
    url: '/project/customer',
    method: 'put',
    data: data
  })
}

// 修改往来客户
export function updateIssueMoney(data) {
  return request({
    url: '/project/customer/issueMoney',
    method: 'put',
    data: data
  })
}



// 修改往来客户
export function updateSubAmount(data) {
  return request({
    url: '/project/customer/updateSubAmount',
    method: 'put',
    data: data
  })
}




// 审核往来客户
export function auditCustomer(data) {
  return request({
    url: '/project/customer/audit',
    method: 'put',
    data: data
  })
}

// 删除往来客户
export function delCustomer(id) {
  return request({
    url: '/project/customer/' + id,
    method: 'delete'
  })
}
